﻿<%@ Page Language="C#" MasterPageFile="~/Org/MasterPage.master" AutoEventWireup="true"
    CodeFile="frmO_EmpContractTypeInput.aspx.cs" Inherits="Org_frmO_EmpContractTypeInput" EnableEventValidation="false"
    Title="雇用情報登録" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    雇用情報登録
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div>

        <script type="text/javascript" language="javascript" src="../js/jquery.min.js">
        </script>
                <script type="text/javascript" language="javascript" src="../js/Validation.js">
        </script>
        <script type="text/javascript" language="javascript" src="../js/jquery.maskedinput.js">
        </script>

        <script type="text/javascript">
            function CheckExistNull(src, args) {
                var text1 = $("#<%=txt_実際開始日.ClientID%>").val();
                if (text1 != "")
                    if (args.Value == "")
                        args.IsValid = false;
                    else
                        args.IsValid = true;        
            }

            function Check2Valid(source, args) {
                if (args.Value != "") {
                    ValidatorEnable2(document.getElementById("<%= CustomValidator1.ClientID %>"), true);
                }
                
            }
            function CompareDate(src, args) {
                var date_start = $('input[id$=txt_発令開始日]').val();
                args.IsValid = checkYearOld( date_start, args.Value, 0, "<=");
            }

            $(document).ready(function() {

            registerEnterEvent("enter", "<%= btn登録.ClientID %>", 3);
            registerControlToValidation("validation");
            formatDate("css_text_calender", "/");

            });

        
        </script>

    </div>
    <div class="maindiv1">
    <link href="../Style/Style.css" rel="stylesheet" type="text/css" />
        <div class="Header1">
            ＊: 必須.
        </div>
        <div class="NoteStyle">
            
            <span>※下記の情報があれば、必須項目を入力してください。なければ、次ボタンを押してください。 </span>
        </div>
        <div>
            &nbsp;</div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">雇用区分 :</span>
            <asp:DropDownList ID="ddl_雇用区分" runat="server" Font-Names="MS UI Gothic"
                ValidationGroup="detailform" CssClass="enter dropdownlist width2">
                <asp:ListItem Value="-1" Selected="true">[選択]</asp:ListItem>
            </asp:DropDownList>
        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">発令開始日 :</span>
            <asp:TextBox ID="txt_発令開始日" runat="server" 
                Font-Names="MS UI Gothic" onkeypress="return InputNumberKeys(this, event)"
                ValidationGroup="detailform" Style="ime-mode: disabled" 
                CssClass="enter validation css_text_calender textbox width_calendar"></asp:TextBox>
            <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="../Images/calendar.jpg"
                Height="16px" CssClass="cal_Img" CausesValidation="False" ValidationGroup="detailform" />
            <ajaxToolkit:CalendarExtender ID="CalendarExtender_1" runat="server" PopupButtonID="ImageButton1"
                TargetControlID="txt_発令開始日" Format="yyyy/MM/dd">
            </ajaxToolkit:CalendarExtender>
            &nbsp;<%--<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
                ErrorMessage="" ControlToValidate="txt_発令開始日" ValidationExpression="^((((19|20)(([02468][048])|([13579][26]))[- /.]02[- /.]29))|((20[0-9][0-9])|(19[0-9][0-9]))[- /.]((((0[1-9])|(1[0-2]))[-  /.]((0[1-9])|(1\d)|(2[0-8])))|((((0[13578])|(1[02]))[- /.]31)|(((0[1,3-9])|(1[0-2]))[- /.](29|30)))))$"
                Display="None" SetFocusOnError="false"></asp:RegularExpressionValidator>--%>
            <asp:CustomValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="CustomValidator"
                ClientValidationFunction="isDate" Display="None" ControlToValidate="txt_発令開始日"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender11" Width="240px"
                TargetControlID="RegularExpressionValidator1" HighlightCssClass="invalid" CssClass="CustomValidatorCalloutStyle"
                WarningIconImageUrl="../Images/warning.png" />
            <asp:CustomValidator ID="CustomValidator2" runat="server" Display="None" ControlToValidate="txt_発令開始日"
                ClientValidationFunction="CheckExistNull" ValidateEmptyText="true" ErrorMessage="CustomValidator"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender3" Width="260px"
                TargetControlID="CustomValidator2" HighlightCssClass="invalid1" CssClass="CustomValidatorCalloutStyle"
                WarningIconImageUrl="../Images/warning.png" /> 
            <asp:CustomValidator ID="CustomValidator3" runat="server" Display="None" ControlToValidate="txt_発令開始日"
                ClientValidationFunction="Check2Valid" ValidateEmptyText="true" ErrorMessage="CustomValidator"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender4" Width="260px"
                TargetControlID="CustomValidator3" HighlightCssClass="invalid2" CssClass="CustomValidatorCalloutStyle"
                WarningIconImageUrl="../Images/warning.png" />        
        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">実際開始日 :</span>
            <asp:TextBox ID="txt_実際開始日" runat="server" 
                Font-Names="MS UI Gothic" onkeypress="return InputNumberKeys(this, event)"
                ValidationGroup="detailform" Style="ime-mode: disabled" 
                CssClass="enter validation css_text_calender enter dropdownlist width2"></asp:TextBox>
            <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="../Images/calendar.jpg"
                Height="16px" CssClass="cal_Img" CausesValidation="False" ValidationGroup="detailform" />
            <ajaxToolkit:CalendarExtender ID="CalendarExtender2" runat="server" PopupButtonID="ImageButton2"
                TargetControlID="txt_実際開始日" Format="yyyy/MM/dd">
            </ajaxToolkit:CalendarExtender>
            <%--<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage=""
                ControlToValidate="txt_実際開始日" ValidationExpression="^((((19|20)(([02468][048])|([13579][26]))[- /.]02[- /.]29))|((20[0-9][0-9])|(19[0-9][0-9]))[- /.]((((0[1-9])|(1[0-2]))[-  /.]((0[1-9])|(1\d)|(2[0-8])))|((((0[13578])|(1[02]))[- /.]31)|(((0[1,3-9])|(1[0-2]))[- /.](29|30)))))$"
                Display="None" SetFocusOnError="false"></asp:RegularExpressionValidator>--%>
            <asp:CustomValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="CustomValidator"
                ClientValidationFunction="isDate" Display="None" ControlToValidate="txt_実際開始日"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender1" Width="240px"
                TargetControlID="RegularExpressionValidator2" HighlightCssClass="invalid1" CssClass="CustomValidatorCalloutStyle"
                WarningIconImageUrl="../Images/warning.png" />
            <asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="Compare"
                Display="None" SetFocusOnError="false" ControlToValidate="txt_実際開始日" ClientValidationFunction="CompareDate"></asp:CustomValidator>
            <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender2" Width="260px"
                TargetControlID="CustomValidator1" HighlightCssClass="invalid2" CssClass="CustomValidatorCalloutStyle"
                WarningIconImageUrl="../Images/warning.png" />
        </div>
        <br />
        <div class="detail-admin-row">
            <span class="detail-admin-label">&nbsp;</span>
            <asp:Button ID="btn登録" runat="server" Text="登録" CssClass="btn" OnClientClick="javascript:focusToControlErr();" OnClick="btn登録_Click"  />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="btnリセット" runat="server" Text="リセット" CssClass="btn" OnClick="btnリセット_Click"
                CausesValidation="False" />
        </div>
        <div class="headerLineAndGray">
                ※ 雇用情報一覧
            </div>
          <div style="margin: 10px 50px 50px" class="detail-admin-row">
                <asp:GridView ID="grv_human" runat="server" AutoGenerateColumns="False" AllowPaging="true"
                    DataKeyNames="ID" PageSize="10" PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt"
                    GridLines="Vertical" Height="40px" Width="100%" CssClass="mGrid" 
                    Font-Names="MS UI Gothic" onprerender="grv_human_PreRender" 
                    onrowcommand="grv_human_RowCommand" onrowdatabound="grv_human_RowDataBound" 
                    onselectedindexchanging="grv_human_SelectedIndexChanging" 
                    onpageindexchanging="grv_human_PageIndexChanging"  >
                    <Columns>
                       
                        <asp:TemplateField HeaderText="雇用区分" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="140px">
                            <ItemTemplate>
                                <asp:Label ID="lbl_雇用区分" runat="server" Text='<%# ConvertNumberTypeToChar(Eval("雇用区分")) %>' ></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="発令開始日" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="140px">
                            <ItemTemplate>
                                <asp:Label ID="lbl_発令開始日" runat="server" Text='<%# Eval("発令開始日", "{0:yyyy年MM月dd日}") %>' ></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="実際開始日" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="140px">
                            <ItemTemplate>
                                <asp:Label ID="lbl_実際開始日" runat="server" Text='<%# Eval("実際開始日", "{0:yyyy年MM月dd日}") %>' ></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                       
                    </Columns>
                </asp:GridView>
            </div>
    </div>
    <div class="detail-admin-row">
        <div class="btn_back">
            <asp:Button ID="btn_戻る" runat="server" Text="←戻る" OnClick="btn_戻る_Click" CssClass="btn"
                CausesValidation="False" />
        </div>
        <div class="btn_next">
            <asp:Button ID="btn_次" runat="server" Text="次→" OnClick="btn_次_Click" CssClass="btn"
                CausesValidation="False" />
        </div>
    </div>
    <div>
        &nbsp;</div>
    <br />
    
</asp:Content>
